package com.ibm.interview.brno;

public class OddEvenNumbersJavaInterview {

    public int [][] sortOutOddAndEvenNumbers(final int [] input) {
        final int result [][] = new int [2][input.length];
        int evenIdx = 0;
        int oddIdx = 0;
        for (int i = 0; i < input.length; i++) {
            if (input [i] % 2 == 0) {
                result [0] [evenIdx++] = input [i];
            } else {
                result [1] [oddIdx++] = input [i];
            }
        }
        return result;
    }
}
